//
//  WDDAlertController.m
//  NewLearningSystem
//
//  Created by wangdongdong on 2017/9/5.
//  Copyright © 2017年 ttsx. All rights reserved.
//

#import "WDDAlertController.h"

@interface WDDAlertController ()

@end

@implementation WDDAlertController

// 确定
- (UIButton *)sureBtn {
    if (!_sureBtn) {
        // 确定按钮
        _sureBtn = [[UIButton alloc] init];
        [_sureBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_sureBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
        _sureBtn.titleLabel.font = [UIFont systemFontOfSize:13];
        [_sureBtn setTitle:@"确认" forState:UIControlStateNormal];
        
        // 圆角和边框
        _sureBtn.backgroundColor = UIColorFromRGB(0x009688);
        _sureBtn.layer.cornerRadius = 5;
        _sureBtn.layer.masksToBounds = YES;
        _sureBtn.userInteractionEnabled = NO;
    }
    return _sureBtn;
}

// 取消
- (UIButton *)cancelBtn {
    if (!_cancelBtn) {
        // 取消按钮
        _cancelBtn = [[UIButton alloc] init];
        [_cancelBtn setTitleColor:UIColorFromRGB(0x999999) forState:UIControlStateNormal];
        [_cancelBtn setTitleColor:UIColorFromRGB(0x999999) forState:UIControlStateSelected];
        _cancelBtn.titleLabel.font = [UIFont systemFontOfSize:13];
        [_cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
        
        // 圆角和边框
        _cancelBtn.backgroundColor = UIColorFromRGB(0xf6f6f6);
        _cancelBtn.layer.cornerRadius = 5;
        _cancelBtn.layer.masksToBounds = YES;
        _cancelBtn.userInteractionEnabled = NO;
    }
    return _cancelBtn;
}

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.view.clipsToBounds = YES;
//    self.view.layer.masksToBounds = YES;
    
    // titleView
//    UIView *titleView = [[UIView alloc] init];
//    [self.view addSubview:titleView];
//    [titleView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.offset(0);
//        make.left.offset(0);
//        make.right.offset(0);
//        make.height.offset(34);
//    }];
//    titleView.backgroundColor = UIColorFromRGB(0x009688);
//    titleView.layer.cornerRadius = 5;
//    titleView.layer.masksToBounds = YES;
//    titleView.clipsToBounds = YES;
//    titleView.layer.masksToBounds = YES;
    
    // 添加确定
    [self.view addSubview:self.sureBtn];
    [_sureBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.offset(-10);
        make.left.offset(25);
        make.width.offset(85);
        make.height.offset(26);
    }];
    
    // 添加取消
    [self.view addSubview:self.cancelBtn];
    [_cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.offset(-10);
        make.right.offset(-25);
        make.width.offset(85);
        make.height.offset(26);
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end

